﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Collections.ObjectModel;

namespace NodeExpander
{
    public class ExpanderSlot : IExpanderSlot
    {
        private List<IExpanderSlot> slots;

        public int SlotIndex { get; set; }
        public string SlotText { get; set; }
        public bool AutoShow { get; set; }
        public bool IsRequired { get; set; }
        public FrameworkElement InputView { get; set; }
        public FrameworkElement DescriptionView { get; set; }
        public IExpanderSlot PreviousSlot { get; set; }
        public IExpanderSlot NextSlot { get; set; }

        public ExpanderSlot()
        {
        }

        public ExpanderSlot(string slotText)
        {
            this.SlotText = slotText;
        }

        public ExpanderSlot(int slotIndex, string slotText, bool autoShow, bool isRequired, FrameworkElement inputView, FrameworkElement descriptionView, IExpanderSlot previousSlot, IExpanderSlot nextSlot)
        {
            this.SlotIndex = slotIndex;
            this.SlotText = slotText;
            this.AutoShow = autoShow;
            this.IsRequired = isRequired;
            this.InputView = inputView;
            this.DescriptionView = descriptionView;
            this.PreviousSlot = previousSlot;
            this.NextSlot = nextSlot;
        }

        public List<IExpanderSlot> Slots
        {
            get
            {
                if (slots == null)
                {
                    slots = new List<IExpanderSlot>(); 
                }

                return slots;
            }
            set
            {
                slots = value;
            }
        }

    }

    public interface IExpanderSlot
    {
        List<IExpanderSlot> Slots { get; set; }
        int SlotIndex { get; set; }
        string SlotText { get; set; }
        bool AutoShow { get; set; }
        bool IsRequired { get; set; }
        FrameworkElement InputView { get; set; }
        FrameworkElement DescriptionView { get; set; }
        IExpanderSlot PreviousSlot { get; set; }
        IExpanderSlot NextSlot { get; set; }
    }

    public class ExpanderSlotEventArgs : EventArgs
    {
        private IExpanderSlot slot;

        public ExpanderSlotEventArgs(IExpanderSlot slot)
        {
            this.slot = slot;
        }
    }

    
}
